import Vue from 'vue'
import App from './App.vue'
import router from './router'
// import Vant from 'vant';
// import 'vant/lib/index.css';

// Vue.use(Vant);

//利用router方法beforeEach
router.beforeEach((to,from,next)=>{

  if(to.meta.title){
    document.title = to.meta.title
  }
  next()
})

//监听窗口变化
var html=document.querySelector('html')  ;
var homeWith = window.innerWidth ;
if(homeWith > 500 ){
  homeWith = 500 ;
}
html.style.fontSize= homeWith*100/375+'px' ;

window.addEventListener('resize',function(){
  console.log(document.body.offsetWidth)
  html.style.fontSize= homeWith*100/375+'px' ;
})


Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
